<?php

namespace app\admin\model;

use think\Model;
use think\Db;

class Users extends Model
{

    public function users(){
        $data = db('users')->select();
        return $data;
    }

    public function user_mess($id){
        $data = db('messages')->where(['a.user_id' => $id])->field('a.*,b.title')->alias('a')->join('lan_article b','a.article_id=b.id')->select();
        return $data;
    }

    public function reply_mess($id){
        $data = db('messages')->where(['user_id' => $id , 'article_id' =>0])->select();
        return $data;
    }
}
